<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CMS——Codeigniter demo</title>
<script src="<?php echo base_url().$this->config->item('public');?>assets/js/edit.js"></script>
</head>
<body>
<script>


	//select 选择框选中多个值
	function setCategoryId(selectObj,hiddenObj){
		elementById(hiddenObj).value = getCheckVlue(selectObj);
	}
</script>
<?php
	if(!empty($result)){
		echo "<p>".$result."</p>";
	}


	if(!empty($articles)){
		$js="onsubmit=setCategoryId('category_id_checkbox','category_id')";
		echo form_open("article/edit",$js);
		echo form_hidden('action','update');
		echo form_hidden('id',$articles['id']);
		
		echo "<p>";
		echo form_label('标题','title');
		echo form_input('title',$articles['title']);
		echo "</p>";
		
		echo "<p>";
		$data = array(
		'name'        => 'status',
		'id'          => 'status',
		'value'       => '1',
		'checked'     => ($articles['status']==1)?true:false,
		'style'       => 'margin:10px',
		);

		echo form_radio($data); 
		echo form_label('启用');
		
		$data = array(
		'name'        => 'status',
		'id'          => 'status',
		'value'       => '0',
		'checked'     => ($articles['status']==0)?true:false,
		'style'       => 'margin:10px',
		);

		echo form_radio($data);
		echo form_label('不启用');
		echo "</p>";
		
		echo "<p>";
		echo form_label('所属分类','category_id');
?>

   <div class="row">
      
	
<?php		
			
		$this->category->getTreeCheckbox($cates,'category_id_checkbox',$category_id,0);
		echo "<input type='hidden' name='category_id' id='category_id'>";
		echo "</p>";
		
		echo "<p>";
		echo form_label('内容','text');
		
		//初始化内容编辑器
		$editor = array(
			'name' => 'text',
			'id' => "content_text",
			'value' => $articles['text'],
			'style' => "width:100%"	//附加的样式，重置模板默认样式
			//other ...
		);
		$this->load->view('plugin/kindeditor',$editor);
		
		echo "</p>";
		
		echo form_submit('','提交更改');
		echo form_close();
	}

?>

</body>
</html>